﻿using System.ServiceModel;

namespace AzManPermissions
{
  /// <summary>
  /// Contract for remote AzMan service.
  /// </summary>
  /// <remarks>
  /// The WCF service which <see cref="T:AzManPermissions.AzManOperationRemotePermission" /> connects to check whether the user is allowed perform specific operations.
  /// </remarks>
  [ServiceContract]
  public interface IAzManService
  {
    /// <summary>
    /// Checks whether the current principal is allowed to perform the operation described in parameters.
    /// </summary>
    /// <param name="name">The name of the <see cref="T:System.Security.Principal.IPrincipal" /> object's user.</param>
    /// <param name="objectName">The string used for AzMan run-time auditing.</param>
    /// <param name="scopeName">The name of a scope as defined in the AzMan store.</param>
    /// <param name="operation">The AzMan operation number to check for.</param>
    /// <returns>True, if the <see cref="T:System.Security.Principal.IPrincipal" /> object's user is allowed to perform the described operation.</returns>
    [OperationContract]
    bool AccessCheck(string name, string objectName, string scopeName, int operation);
  }
}